|
RtkCreateSharedMemory creates a named region of physical memory that can be mapped by any process.
Syntax
HANDLE RtkCreateSharedMemory( RTSSINST RtssInst, PULONG pErrorCode, DWORD flProtect, DWORD MaximumSizeHigh, DWORD MaximumSizeLow, PUNICODE_STRING lpName, VOID ** location );
Parameters
RtssInst
An RTSSINST value returned from a call to RtkRtssAttach.
pErrorCode
A pointer to a location where additional error information may be returned. This location need not be defined; the user may pass a NULL value. If defined, this location is set to NULL if no error occurred.
flProtect (ignored by RTSS)
The protection desired for the shared memory view. This parameter can be one of the following values:
MaximumSizeHigh
The high-order 32 bits of the size of the shared memory object.
MaximumSizeLow
The low-order 32 bits of the size of the shared memory object.
lpName
A pointer to a PUNICODE_STRING specifying the name of the shared memory object. The name is limited to RTX_MAX_PATH characters and can contain any character except the backslash path-separator character (\). Name comparison is case-sensitive.
If this parameter matches the name of an existing named shared memory object, the function requests access to the shared memory object with the protection specified by flProtect.
location
A pointer to a location where the virtual address of the shared memory will be stored.
Return Values
A handle to the shared memory object if the function succeeds, NULL if the function fails.
If the object existed before the function call, ErrorCode, if defined, contains ERROR_ALREADY_EXISTS, and the return value is a valid handle to the existing shared memory object. If the function call included a memory size parameter that differed from the size of the existing memory object, the size of the existing memory object is not changed.
Remarks
The handle that RtkCreateSharedMemory returns has full access to the new shared memory object. Shared memory objects can be shared by name. For information on opening a shared memory object by name, see RtkOpenSharedMemory.
To fully close a shared memory object, an application must close the physical mapping object handle by calling RtkCloseHandle. The order in which these functions are called does not matter.
When all handles to the shared memory object representing the physical memory are closed, the object is destroyed and physical memory is returned to the system.
Requirements
Header | Rtkapi.h |
Library | rtx_rtk.lib |
See Also: